package com.ksd.exception;


import com.ksd.result.EResultCode;
import com.ksd.result.IResultCode;

/**
 * 自定义API异常
 * Created by zfjk on 2020/2/27.
 */
public class KsdValidationException extends ApiException {

    private Integer code;

    private String message;


    public KsdValidationException(String message) {
        super(message);
        this.code = EResultCode.FAILED.getCode();
        this.message = message;
    }

    public KsdValidationException(IResultCode iResultCode) {
        super(iResultCode.getDesc());
        this.code = iResultCode.getCode();
        this.message = iResultCode.getDesc();
    }

    public KsdValidationException(Integer code, String message) {
        super(message);
        this.code = code;
        this.message = message;
    }

    public String getMessage() {
        return message;
    }

    public Integer getCode() {
        return code;
    }
}
